const express = require('express')
const router = express.Router()
const weatherDao = require('../database/weatherDao')

router.get('/getWeatherData',async (req,res) => {
  try{
    let result = await weatherDao.getWeatherData()
    res.send({
      code:200,
      msg:'获取成功',
      data:result
    })
  }catch(err){
    res.send({
      code:400,
      msg:'获取失败',
      data:err
    })
  }
})

module.exports = router